<script>
jQuery(function(jQuery){
  jQuery(".collection a").click(function(){
    #if($!user)
     #if($!user.id==$!obj.goods_store.user.id)
	   alert("不能收藏自己的店铺");
	 #else
	   jQuery.post("$!webPath/add_store_favorite.htm",{"id":"$!store.id"},function(data){
		 if(data==0){
		     alert("店铺收藏成功！");
		 }
		 if(data==1){
		    alert("该店铺已经被收藏！");
		 }
	   },"text");
	 #end
   #end
  });
  //
  jQuery("span[id^=ugc_]").css("cursor","pointer").click(function(){
     var ugc_type=jQuery(this).attr("ugc_type");
	 var ugc_id=jQuery(this).attr("ugc_id");
	 if(ugc_type=="show"){
	    jQuery(this).find("img").attr("src","$!webPath/resources/style/shop/$!{store.template}/images/add.jpg");
		jQuery("#ugc_child_"+ugc_id).hide();
	    jQuery(this).attr("ugc_type","hide");
	 }else{
	    jQuery(this).find("img").attr("src","$!webPath/resources/style/shop/$!{store.template}/images/add2.jpg");
		jQuery("#ugc_child_"+ugc_id).show();
	    jQuery(this).attr("ugc_type","show");
	 }
  }); 
  //
  jQuery(".twocoad").css("cursor","pointer").mouseover(function(){
     jQuery(".shop_botmhbox").fadeIn('fast'); 
  }).mouseleave(function(){
     jQuery(".shop_botmhbox").fadeOut('fast'); 
  });
  //
  jQuery(".shop_rank_top li").css("cursor","pointer").mouseover(function(){
    var sort_id=jQuery(this).attr("sort_id");
	jQuery(".shop_rank_top li").removeClass("this");
	jQuery(this).addClass("this");	
	jQuery(".shop_rank_botm").hide();
	jQuery("#"+sort_id).show();
  });
});
</script>

<div class="shopindex_left">
  <div class="shoptop">
    <h1>$!store.store_name</h1>
    <div class="shopvalue">
      <dl class="shopvdl">
        <dt><span> #if($!store.store_logo)
          #set($store_logo="$!webPath/$!{store.store_logo.path}/$!{store.store_logo.name}")
          #else
          #set($store_logo="$!webPath/$!config.storeImage.path/$!config.storeImage.name")
          #end <img src="$!store_logo" width="60" height="60" /> </span></dt>
        #set($credit=$!storeViewTools.generic_store_credit("$!store.id"))
        #set($img="$!imageWebServer/resources/style/common/images/level_0.gif")
        #if($credit<10 && $credit>0)
        #set($credit=${credit} / 2)
        #set($credit=$credit+1)
        #end
        #if($credit>=20)
        #set($img="$!imageWebServer/resources/style/common/images/level_2.gif") 
        #set($credit=($credit - 20)/2) 
        #set($credit=$credit+1)
        #end
        #if($credit>=10)
        #set($img="$!imageWebServer/resources/style/common/images/level_1.gif") 
        #set($credit=($credit - 10)/2)
        #set($credit=$credit+1)
        #end
        #if($credit>5)#set($credit=5)#end
        <dd><span >$!store.store_ower<a href="$!webPath/buyer/message_send.htm?userName=$!{store.user.userName}" target="_blank" class="shopemail"><img src="$!imageWebServer/resources/style/shop/green/images/mail.jpg" width="15" height="11" /></a></span><span>#if($!credit==0) <img src="$!imageWebServer/resources/style/common/images/level_-1.gif"/> #else #foreach($count in [1..$!credit])<img style="margin-left:1px;" src="$!img" />#end #end</span> #set($store_evaluate1="$!CommUtil.mul($!{store.point.store_evaluate1},100)%") <span class="hui2">好评率：$!{store_evaluate1}</span></dd>
      </dl>
      <h1>动态评价<i>与同行比较</i></h1>
      <ul class="shop_movepj">
        <li><i>描述相符：</i><b>$!{store.point.description_evaluate}</b><em class="$!description_css"><strong>$!description_type</strong>$!description_result</em></li>
        <li><i>服务态度：</i><b>$!{store.point.service_evaluate}</b><em class="$!service_css"><strong>$!service_type</strong>$!service_result</em></li>
        <li><i>发货速度：</i><b>$!{store.point.ship_evaluate}</b><em class="$!ship_css"><strong>$!ship_type</strong>$!ship_result</em></li>
      </ul>
      <h1>店铺信息</h1>
      <ul>
        <li>创店时间：$!CommUtil.formatShortDate($!store.addTime)</li>
        <li>所在地区：$!areaViewTools.generic_area_info("$!store.area.id")</li>
        #set($goods_count=0)
        #foreach($!goods_info in $!store.goods_list)
        #if($!goods_info.goods_status==0)
        #set($goods_count=$goods_count+1)
        #end
        #end
        <li>商品数量：<strong class="blue">$!{goods_count}</strong>件商品</li>
        <li>店铺收藏：<strong class="blue">$!{store.favorite_count}</strong>人收藏</li>
        <li>联系电话：$!{store.store_telephone}</li>
      </ul>
      <h1>联系方式</h1>
      <ul>
       <li class="shopcusser"><span>站内客服：</span> <span>
              #if($!user)
              <a class="im_common" href="javascript:void(0);" user_id="$!store.user.id" id="userDialog_img_contact_$!store.user.id" user_name="$!store.user.userName"> 咨询客服</a>
              #else
               <a class="im_common" href="javascript:void(0);" dialog_uri="$!webPath/user_dialog_login.htm" dialog_title="会员登录" dialog_width="450" dialog_height="100" dialog_id="user_login">咨询客服 </a> 

              #end
              </span></li>
        <li class="shopcusser"><span>站外客服：</span> <span><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=$!store.store_qq&Site=$!store.store_qq&Menu=yes"><img alt="点击这里给我发消息" src="http://wpa.qq.com/pa?p=2:$!store.store_qq:51" /></a></span></li>
      </ul>
    </div>
    <div class="shop_botm_hid">
      <ul class="shopboh">
        <li class="collection"><a href="javascript:void(0);" id="store_fav" #if(!$!user)dialog_uri="$!webPath/user_dialog_login.htm" dialog_title="会员登录" dialog_width="450" dialog_height="100" dialog_id="user_login"#end><span>收藏店铺</span></a></li>
        <li class="this"><span class="twocoad">店铺二维码
          <div class="shop_botmhbox" style="display:none;"> <span> <img src="$!imageWebServer/$!config.uploadFilePath/store/$!{store.id}/code.png" width="140" height="140" /></span> <i>手机扫描二维码<br />
            快速收藏店铺</i> </div>
          </span></li>
      </ul>
    </div>
  </div>
  <form action="$!webPath/store_goods_search.htm" method="post" id="store_search_form">
    <div class="shopsearch">
      <ul>
        <li><span class="searspan">关键字：</span><span class="shopsear1">
          <input name="keyword" type="text" id="keyword" />
          </span></li>
        <li><span class="searspan">&nbsp;</span><span class="searbtns">
          <input name="input2" type="submit"  value="搜索"  style="cursor:pointer;"/>
          </span>
          <input name="store_id" type="hidden" id="store_id" value="$!store.id" />
        </li>
      </ul>
    </div>
  </form>
  <div class="shopclassify">
    <h1>商品分类</h1>
    <!--箭头sort_a,sort_b-->
    <div class="shop_sort"><a href="$!webPath/goods_list.htm?store_id=$!{store.id}&orderBy=addTime&orderType=desc">按默认</a><a href="$!webPath/goods_list.htm?store_id=$!{store.id}&orderBy=store_price&orderType=desc">按价格</a><a href="$!webPath/goods_list.htm?store_id=$!{store.id}&orderBy=goods_salenum&orderType=desc">按销量</a><a href="$!webPath/goods_list.htm?store_id=$!{store.id}&orderBy=goods_click&orderType=desc">按人气</a></div>
    <ul class="shopcul">
      <li><span><img src="$!imageWebServer/resources/style/shop/$!{store.template}/images/add2.jpg" width="15" height="15" /></span><a href="$!webPath/goods_list.htm?store_id=$!{store.id}" class="oneclass">所有商品</a> </li>
      #foreach($ugc in $ugcs)
      #if($!ugc.display)
      <li><span id="ugc_$!{ugc.id}" ugc_type="show" ugc_id="$!ugc.id"><img src="$!imageWebServer/resources/style/shop/$!{store.template}/images/add2.jpg" width="15" height="15" /></span><a href="$!webPath/goods_list.htm?gc_id=$!{ugc.id}&store_id=$!{store.id}" class="oneclass">$!ugc.className</a> #if($! $ugc.childs.size()>0)
        <ul id="ugc_child_$!{ugc.id}">
          #foreach($cugc in $ugc.childs)
          #if($!cugc.display)
          <li><a href="$!webPath/goods_list.htm?gc_id=$!{cugc.id}&store_id=$!{store.id}">$!cugc.className</a></li>
          #end
          #end
        </ul>
        #end </li>
      #end
      #end
    </ul>
  </div>
  <div class="shop_rank">
    <h3>商品排行</h3>
    <div class="shop_rank_box">
      <div class="shop_rank_top">
        <ul>
          <li class="this" sort_id="sort_sale_goods">热销商品排行</li>
          <li sort_id="sort_collect_goods">热门收藏排行</li>
        </ul>
      </div>
      <div class="shop_rank_botm" id="sort_sale_goods"> #foreach($goods in $goodsViewTools.sort_sale_goods("$!store.id",5))
        #if($!goods.goods_main_photo)
        #set($img="$!imageWebServer/$!{goods.goods_main_photo.path}/$!{goods.goods_main_photo.name}_small.$!{goods.goods_main_photo.ext}")
        #else
        #set($img="$!imageWebServer/$!{config.goodsImage.path}/$!{config.goodsImage.name}")
        #end
        <dl>
          <dt><span class="imgcenter_span ">
            <p><a href="$!webPath/goods_$!{goods.id}.htm" target="_blank"><img width="58" height="58" src="$!img" /></a></p>
            </span></dt>
          <dd><span class="shop_rank_name"><a href="$!webPath/goods_$!{goods.id}.htm" target="_blank">$!CommUtil.substring("$!{goods.goods_name}",8)</a></span><span class="shop_rank_money">¥<b>$!{goods.store_price}</b></span><span class="shop_rank_show">出售：<strong>$!{goods.goods_salenum}</strong>笔</span></dd>
        </dl>
        #end </div>
      <div class="shop_rank_botm" style="display:none;" id="sort_collect_goods"> #foreach($goods in $goodsViewTools.sort_collect_goods("$!store.id",5))
        #if($!goods.goods_main_photo)
        #set($img="$!imageWebServer/$!{goods.goods_main_photo.path}/$!{goods.goods_main_photo.name}_small.$!{goods.goods_main_photo.ext}")
        #else
        #set($img="$!imageWebServer/$!{config.goodsImage.path}/$!{config.goodsImage.name}")
        #end
        <dl>
          <dt><span class="imgcenter_span ">
            <p><a href="$!webPath/goods_$!{goods.id}.htm" target="_blank"><img width="58" height="58" src="$!img" /></a></p>
            </span></dt>
          <dd><span class="shop_rank_name"><a href="$!webPath/goods_$!{goods.id}.htm" target="_blank">$!CommUtil.substring("$!{goods.goods_name}",8)</a></span><span class="shop_rank_money">¥<b>$!{goods.store_price}</b></span><span class="shop_rank_show">收藏：<strong>$!{goods.goods_collect}</strong>次</span></dd>
        </dl>
        #end </div>
    </div>
    <div class="shop_check"><a href="$!webPath/goods_list.htm?store_id=$!{store.id}" class="shop_check_a">查看本店其他商品</a></div>
  </div>
  <div class="shopf">
    <h1>友情链接</h1>
    <ul>
      #foreach($partner in $partners)
      <li><a href="$!partner.url" target="_blank">$!partner.title</a></li>
      #end
    </ul>
  </div>
</div>
